#include "precomp.h"

#pragma once

#define MAP_PLAYER 'A'
#define MAP_AI 'B'
#define MAP_WALL '1'

class Map{
public:
	Map(const char* filepath, const char* wall_image_path, CL_GraphicContext *gc, float tile_size);

	~Map();

	char get_tile(int x, int y);

	void draw(float ch_x, float ch_y);

	CL_Point get_tile_position(float x, float y);

	inline bool in_bound(int x, int y){
		return x>=0 && x<_width && y>=0 && y<_height;
	}

	inline int get_width(){
		return _width;
	}

	inline int get_height(){
		return _height;
	}

	inline float get_tile_size(){
		return _tile_size;
	}

	inline CL_Point get_start_position(char a){
		return _start_positions[a - 'A'];
	}

private:
	CL_GraphicContext *_gc;
	string _map_string[100];
	CL_Sprite *_sprite;
	int _width, _height;
	float _tile_size;

	int _character_number;
	CL_Point _start_positions[10];
};